package cn.wolfcode.car.business.domain;

import cn.wolfcode.car.base.domain.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

@Getter
@Setter
public class Contract {
    public static final Integer CON_AFFIX_SEAL_STATE_NO = 0;           // 合同未盖章
    public static final Integer CON_AFFIX_SEAL_STATE_YES = 1;          // 合同已盖章
    public static final Integer CON_AUDIT_STATE_UNAPPROVED = 0;        // 合同未审核
    public static final Integer CON_AUDIT_STATE_APPROVED = 1;          // 合同审核通过
    public static final Integer CON_AUDIT_STATE_REJECT = 2;            // 合同审核不通过
    public static final Integer CON_NULLIFY_STATE_ON = 0;              // 合同在用
    public static final Integer CON_NULLIFY_STATE_OFF = 1;             // 合同作废

    /** */
    private Long id;

    /** 客户id*/
    private String customerId;
    private Customer customer;

    /** 合同名称*/
    private String contractName;

    /** 合同编码*/
    private String contractCode;

    /** 合同金额*/
    private BigDecimal amounts;

    /** 合同生效开始时间*/
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date startDate;

    /** 合同生效结束时间*/
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date endDate;

    /** 是否盖章确认 0 否 1 是*/
    private Integer affixSealState = CON_AFFIX_SEAL_STATE_NO;

    /** 审核状态 0 未审核 1 审核通过 -1 审核不通过*/
    private Integer auditState = CON_AUDIT_STATE_UNAPPROVED;

    /** 是否作废 -1 作废 0 在用*/
    private Integer nullifyState = CON_NULLIFY_STATE_ON;

    /** 录入人*/
    private Long inputUser;
    private User inputer;

    /** 录入时间*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date inputTime;

    /** 附件*/
    private String appendix;
}